<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for the application API.
| These routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group.
|
*/

$router->group(['prefix' => 'api'], function () use ($router) {
    // System Routes
    // $router->post('uploadImage', ['middleware' => 'auth:api', 'uses' => 'Api\\SystemController@uploadImage']);
    // $router->post('uploadResume', ['middleware' => 'auth:api', 'uses' => 'Api\\SystemController@uploadResume']);
});

$router->group(['prefix' => 'api', 'middleware' => 'signature'], function () use ($router) {
    $router->get('/', function () {
        return response()->json(['message' => 'User API Gateway']);
    });
    // Home Routes
    $router->get('/home/init', ['uses' => 'Api\\HomeController@init']);

    // User Routes
    $router->post('/user/login', ['uses' => 'Api\\AuthController@login']);
    $router->put('/user', ['middleware' => 'auth:api', 'uses' => 'Api\\UserController@updateProfile']);
    $router->get('/user/disclaimer', ['uses' => 'Api\\UserController@disclaimer']);
    // Scale Routes
    $router->group(['middleware' => 'auth:api'], function () use ($router) {
        $router->post('/scale/submit', ['uses' => 'Api\\ScaleController@submit']);
        $router->get('/scale/history', ['uses' => 'Api\\ScaleController@historyList']);
        $router->get('/scale/echart', ['uses' => 'Api\\ScaleController@echartHistory']);
    });
    $router->get('/scale/result/{id}', ['uses' => 'Api\\ScaleController@result']);
    $router->get('/scale/{id}', ['uses' => 'Api\\ScaleController@view']);
});
